package com.sigmazero13.MKDummy.activites;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.sigmazero13.MKDummy.R;

public class VolkareSetupDialog extends Dialog {

	OnDismissListener dismissListener;
	EditText numWounds;
	
	public VolkareSetupDialog(Context context, OnDismissListener dismissListener) {
		super(context);
		this.dismissListener = dismissListener;
	}
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.volkare_setup_dialog);
		this.setTitle(R.string.volkare_setup_dialog_title);
		
		numWounds = (EditText)findViewById(R.id.num_wounds_field);
		
		Button ok = (Button)findViewById(R.id.dialog_ok);
		ok.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				dismissListener.onDismiss(VolkareSetupDialog.this);
				dismiss();
			}
		});
	}
	
	public Integer getNumWounds() {
		return Integer.parseInt(numWounds.getText().toString());
	}
}
